﻿namespace ctolua.Models
{
    /// <summary>
    /// 伤害
    /// </summary>
    public class MDamage
    {
        /// <summary>
        /// 攻击类型和防御类型对应的伤害系数
        /// </summary>
        /// <param name="attack_idx ">  攻击类型   </param>
        /// <param name="armor_idx ">  防御类型   </param>
        /// <returns>伤害系数</returns>
        public static double get_damage_ratio(int? attack_idx, int? armor_idx) => game_api.get_damage_ratio(attack_idx, armor_idx).@float();
        /// <summary>
        /// 设置攻击类型和防御类型对应的伤害系数
        /// </summary>
        /// <param name="attack_idx ">  攻击类型   </param>
        /// <param name="armor_idx ">  防御类型   </param>
        /// <param name="damage_ratio ">  伤害系数   </param>

        public static void set_damage_ratio(int? attack_idx, int? armor_idx, Fix32 damage_ratio) => game_api.set_damage_ratio(attack_idx, armor_idx, damage_ratio);
        /// <summary>
        /// 攻击伤害绝对值
        /// </summary>
        /// <param name="damage ">  伤害值   </param>
        /// <returns>伤害绝对值</returns>
        public static double get_hurt_damage(double damage) => game_api.get_hurt_damage(py.Fix32(damage)).@float();

        /// <summary>
        /// 设置当前攻击伤害的数值
        /// </summary>
        /// <param name="damage ">  伤害值   </param>
        public static void set_cur_damage(double damage) => game_api.set_cur_damage(py.Fix32(damage));

        /// <summary>
        /// 获取当次攻击是否闪避
        /// </summary>
        /// <param name="damage_result_state ">  damage_result_state   </param>
        /// <returns>伤害绝对值</returns>
        public static bool? get_cur_damage_is_miss(int? damage_result_state) => game_api.get_cur_damage_is_miss(damage_result_state);

        /// <summary>
        /// 设置当前是否闪避
        /// </summary>
        /// <param name="is_miss ">  是否闪避   </param>
        public void set_cur_damage_is_miss(bool? is_miss) => game_api.set_cur_damage_is_miss(is_miss);
    }
}
